from django.db import models

# Create your models here.
class Publisher(models.Model):
    name = models.CharField('出版社',max_length=50,default='')

    def __str__(self):
        return f"{self.id}-{self.name}"

class Book(models.Model):
    title = models.CharField('书名',max_length=50,default='')
    publisher = models.ForeignKey(Publisher,on_delete=models.CASCADE)

    def __str__(self):
        return f"{self.id}-{self.title}"